<!DOCTYPE HTML>
<html>
<head>
    <title>房屋详情</title>
    <% include common/meta.ejs %>
    <% include common/public.ejs %>
</head>
<body ontouchstart="" style="padding-bottom: 45px;height:auto;">
<div class="swiper-container" data-space-between='10'>
    <div class="swiper-wrapper">
        <% if(data.aimage) { %>
        <div class="swiper-slide">
            <img src="<%= '/yams-upload'+ data.aimage %>" />
        </div>
        <% } %>
        <% if(data.bimage) { %>
        <div class="swiper-slide">
            <img src="<%= '/yams-upload'+ data.bimage %>" />
        </div>
        <% } %>
        <% if(data.cimage) { %>
        <div class="swiper-slide">
            <img src="<%= '/yams-upload'+ data.cimage %>" />
        </div>
        <% } %>
        <% if(data.dimage) { %>
        <div class="swiper-slide">
            <img src="<%= '/yams-upload'+ data.dimage %>" />
        </div>
        <% } %>
        <% if(data.eimage) { %>
        <div class="swiper-slide">
            <img src="<%= '/yams-upload'+ data.eimage %>" />
        </div>
        <% } %>
        <% if(data.fimage) { %>
        <div class="swiper-slide">
            <img src="<%= '/yams-upload'+ data.fimage %>" />
        </div>
        <% } %>
    </div>
    <div class="swiper-pagination"></div>
</div>

<div class="weui_panel weui_panel_access">
    <div class="weui_panel_bd">
        <div class="weui_media_box weui_media_text" style="padding: 1rem;">
            <p style="font-weight:700;font-size: 0.7rem;color: #141414;margin-bottom: 0.2rem"><%= data.shortDesc %></p>
            <p class="weui_media_desc"><%= data.name %></p>
        </div>
        <div class="weui-row">
            <div class="weui-col-33">
                <p>租金</p>
                <p class="x-fs-080">
                    <%= data.shortPrices.SRT00 %>元/天
                </p>
            </div>
            <div class="weui-col-33">
                <p>房型</p>
                <p class="x-fs-080"><%= data.houseTypeName %></p>
            </div>
            <div class="weui-col-33">
                <p>面积</p>
                <p class="x-fs-080"><%= data.area %>㎡</p>
            </div>
        </div>
    </div>
</div>

<div class="weui_cells_title">房屋详情</div>
<div class="weui_cells" style="font-size: 0.7rem;">
    <div class="weui_cell">
        <div class="weui_cell_bd">
            <p>区域：</p>
        </div>
        <div class="weui_cell_ft">
            <%= data.apartmentName %>
        </div>
    </div>
    <div class="weui_cell">
       <!-- <div class="weui_cell_bd">
            <p>地址：</p>
        </div>
        <div class="weui_cell_ft">
            <%= data.myAddress %>
        </div>-->
        <div class="weui_cell_bd" style="width: 70em">
            <p>地址：<%= data.myAddress %></p>
        </div>
        <div class="weui_cell_ft" id="milkMap">
            <img src="<%= global.config.publicPath %>/page/images/mapSet.png" style="width: 20%;height: 20%">
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd ">
            <p>楼层：</p>
        </div>
        <div class="weui_cell_ft">
            <%= data.floor %>层
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd">
            <p>金额：</p>
        </div>
        <div class="weui_cell_ft">
            ￥<%= data.shortPrices.SRT03 %>/3小时
            ￥<%= data.shortPrices.SRT05 %>/5小时
            ￥<%= data.shortPrices.SRT08 %>/8小时
        </div>
    </div>
    <!--<div class="weui_cell">
        <div class="weui_cell_bd">
            <p>加床费：</p>
        </div>
        <div class="weui_cell_ft">
            ￥<%= data.monthly %>/张
        </div>
    </div>-->
    <div class="weui_cells" style="font-size: 0.7rem;;padding: 10px">
        <div>
            <%- data.uedit %>
        </div>
    </div>
</div>

<div class="bottomBar">
    <a href="shortRentReserved?houseId=<%= data.id %>&openId=<%= session.openId %>" class="weui_btn weui_btn_primary">预订此房间</a>
</div>
<!--<div style="text-align: center;width: 100%;padding: 20px 0;">-->
    <!--<a href="houseReserved?houseId=<%= data.id %>" class="weui_btn weui_btn_warn">预定此房间</a>-->
<!--</div>-->
<% include common/footer.ejs %>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
<script src="<%= global.config.publicPath %>/Swiper/3.3.1/js/swiper.jquery.<%= global.config.mode %>js"></script>
<script>
    $(".swiper-container").swiper({
        loop: true,
        autoplay: 3000
    });
</script>
<script type="text/javascript">
    var zuobiao=`<%=data.apartment.lngAndLat %>`;
    var a = zuobiao.split(",");
    console.log(a[0]);
    console.log(a[1]);
    wx.config({
        debug: false,
        appId: "<%= data.appId %>", // 必填，公众号的唯一标识
        timestamp: "<%= data.timestamp %>",
        nonceStr: "<%= data.nonceStr %>",
        signature: "<%= data.signature %>",
        jsApiList: [  // 必填，需要使用的JS接口列表
            'getLocation',
            'openLocation'
        ]
    });
    wx.ready(function(){
        $("#milkMap").click(function () {
            wx.openLocation({
                latitude: a[0], // 纬度，浮点数，范围为90 ~ -90
                longitude: a[1], // 经度，浮点数，范围为180 ~ -180。
                name: '<%= data.myAddress %>', // 位置名
                address: '<%= data.myAddress %>', // 地址详情说明
                scale: 10, // 地图缩放级别,整形值,范围从1~28。默认为最大
                infoUrl: '' // 在查看位置界面底部显示的超链接,可点击跳转
            });
        });
    });

    wx.error(function(res) {
        // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。
    });
</script>
</body>
</html>